<?php
defined('IN_IA') or exit('Access Denied');
global $_W, $_GPC;
$uniacid = $_W['uniacid'];
$list = pdo_fetch("SELECT * FROM " . tablename($this->tablecate) . " WHERE uniacid = '{$uniacid} '");
if ($list) {
	message('已有数据，请清空后重试！', referer(), 'error');
} else {
	$autodata = "女装|../addons/bsht_tbk/res/icon/1.png|1|99,男装|../addons/bsht_tbk/res/icon/2.png|1|98,鞋子|../addons/bsht_tbk/res/icon/3.png|1|97,箱包||0|66,母婴|../addons/bsht_tbk/res/icon/5.png|1|95,美妆|../addons/bsht_tbk/res/icon/6.png|1|94,居家|../addons/bsht_tbk/res/icon/7.png|1|93,家纺||0|66,文体||0|66,数码||0|66,内衣|../addons/bsht_tbk/res/icon/4.png|1|96,配饰||0|66,9.9元包邮||0|55,20元封顶||0|54,优惠券||0|53,特惠直播||0|52";
	$autodata = explode(',', $autodata);
	foreach ($autodata as $data) {
		$data = explode('|', $data);
		if (empty($data[1])) {
			$data[1] = '';
		}
		pdo_insert($this->modulename . '_cate', array('uniacid' => $uniacid, 'name' => $data[0], 'pic' => $data[1], 'status' => '1', 'isindex' => $data[2], 'displayorder' => $data[3]));
	}
}
message('初始化分类成功！', referer(), 'success');